#ifndef SCREENING_H
#define SCREENING_H
#include "detColisao.h"

class Screening : public DetecColisao
{			// Algoritmo Screening
    protected:

        double CellSize;
        SPHERE*** Cell;

	public:

        Screening()
        {
            Memory = 0;
            Spheres = NULL;
            MinR[0] = MinR[1] = MaxR[0] = MaxR[1] = 0.0;
            //threadEsfera= new SPHERE*[omp_get_num_procs()];
            Cell = NULL;
        }
        Screening (REAL max, MODEL *pModel,ForcaInteracao* t)
        {
            Cell = NULL;
            assert (&pModel->SPHList!=NULL);
            Spheres = &pModel->SPHList;
            iniciaMatriz( max,pModel->BoxMin, pModel->BoxMax );
           // Memory = 0;
            //threadEsfera= new SPHERE*[omp_get_num_procs()];
            Forca = t;
        }

        ~Screening() {
            if (Cell != NULL) {
                for (long i = 0; i < Rows+2; i++) delete [] Cell[i];
                delete [] Cell;
            }
        }

        void iniciaMatriz( REAL max_rad, REAL min_r[2], REAL max_r[2] );
        void CriaMatriz();
        void calcular();
};
#endif
